import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/login/loginPage.vue') },
    { path: '/register', component: () => import('@/views/register/registerPage.vue') },
    {
      path: '/',
      component: () => import('@/views/layout/layoutPage.vue'),
      redirect: '/list/search',
      children: [
        { path: '/list/search', component: () => import('@/views/list/searchPage.vue') },
        { path: '/list/card', component: () => import('@/views/list/cardPage.vue') },
        { path: '/user/center', component: () => import('@/views/user/centerPage.vue') },
        { path: '/user/setting', component: () => import('@/views/user/settingPage.vue') },
      ],
    },
  ],
})

export default router
